﻿using System.Reflection;
using System.Runtime.CompilerServices;

namespace daonaite.MasaUi.Util
{
    /// <summary>
    /// 扩展
    /// </summary>
    public static class Extends
    {
        /// <summary>
        /// 添加api地址到容器
        /// </summary>
        /// <param name="service"></param>
        /// <returns></returns>
        public static IServiceCollection addapi(this IServiceCollection service)
        {
            var tps = Assembly.GetExecutingAssembly().GetTypes();
            foreach (var item in tps)
            {
                if(item.Namespace == "daonaite.MasaUi.Api")
                {
                    service.AddScoped(item);
                }
                
            }

            return service;
        }
    }
}
